<?php
//start or continue session
session_start();
//echo '<pre>' . var_dump($_SESSION) . '</pre>';
if(!isset($_SESSION['logged'])||
(($_SERVER["PHP_SELF"]==$adminAcc_link ||
	$_SERVER["PHP_SELF"]==$editTemplate_link ||
	$_SERVER["PHP_SELF"]==$publishDoc_link ||
	$_SERVER["PHP_SELF"]==$editSchema_link
	) && $_SESSION['access_level']<3)
) {
	header('Refresh: 5, URL='.$homepage_link.'?redirect=' . $_Server['PHP_SELF']);
	echo'<p>You need to be authoritized to access this page. Please wait to be redirected to the home page in 5 seconds.</p>';
	echo'<p>If your browser doesn\'t redirect you automatically, ' .
		'<a href="'.$homepage_link.'?redirect=' . $_SERVER['PHP_SELF'] .
		'"> Click here </a>.</p>';
		include('footer.inc.php');
		die();

}
?>

